/* GUI CONVERTED from rcschup.p (converter v1.76) Thu Aug 30 04:44:35 2001 */
/* rcschup.p - UPDATE SCHEDULE SHIP QUANTITY                                  */
/*Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                         */
/*All rights reserved worldwide.  This is an unpublished work.                */
/*V8:ConvertMode=Maintenance                                                  */
/*V8:RunMode=Character,Windows                                                */

/* $Revision: 1.2 $       BY: Rajaneesh S.   DATE: 08/26/01 ECO: *M1J8*           */

/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}

define input parameter l_nbr       like absr_nbr       no-undo.
define input parameter l_qty       like absr_qty       no-undo.
define input parameter l_line      like absr_line      no-undo.
define input parameter l_type      like absr_type      no-undo.
define input parameter l_date      like absr_date      no-undo.
define input parameter l_interval  like absr_interval  no-undo.
define input parameter l_reference like absr_reference no-undo.
define input parameter l_rlse_id   like absr_rlse_id   no-undo.
define input parameter l_time      like absr_time      no-undo.


find schd_det
   where schd_type      = l_type
     and schd_nbr       = l_nbr
     and schd_line      = l_line
     and schd_rlse_id   = l_rlse_id
     and schd_date      = l_date
     and schd_time      = l_time
     and schd_interval  = l_interval
     and schd_reference = l_reference
   exclusive-lock no-error.

if available schd_det
then do:
   /* UNCONFIRM PEGGED SHIPPER LINES */
   if execname = "rcunis.p"
   then
      assign
         schd_all_qty  = max(schd_all_qty + l_qty, 0)
         schd_ship_qty = schd_ship_qty - l_qty.

   /* CONFIRM PEGGED SHIPPER LINES */
   else
      assign
         schd_all_qty  = max(schd_all_qty - l_qty, 0)
         schd_ship_qty = schd_ship_qty + l_qty.

end. /* IF AVAILABLE schd_det */
